<%@ page language="java" contentType="text/html; charset=UTF-8" isELIgnored="false"
    pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>请求代理日志报表</title>
<%@ include file="/base/base.jsp" %>

<style type="text/css">
	.btn_a{
		display:block;
		float:left;
		width:50px;
		height:20px;
		background: #5CACEE;
		border:1px solid black;
		cursor: pointer;
		margin-right:3px;
		color:black;
	}
	.btn_a:HOVER{
		background:#7EC0EE;
		
	}
	
	input[type='text']{
		height:23px;
	}
	select{
		height:23px;
	}
	
	#result_table,#result_table tr,#result_table td{
		border-color: #D2D2D2;
	}
</style>

<script type="text/javascript">
//表格列数据
var columns=[
	{display:"序号",width:80,render:function(rowData,rowIndex){
		return (parseInt(this.get("page"))-1)*parseInt(this.get("pageSize"))+rowIndex+1;
	}},
	{display:"渠道代码",name:"channelCode",width:200},
	{display:"渠道名称",name:"channelName",width:200},
	{display:"申请日期",name:"time",width:150},
	{display:"申请ip总数",name:"applyCount",width:130},
	{display:"ip为空的总数",name:"nullCount",width:130}
	
];







$(function(){
	initTime();
	initGrid();
	realTimesearch();
});
//初始化日期时间
function initTime(){
	var now=new Date();
	var year=now.getFullYear();
	var month=now.getMonth()+1;
	month=month<10?"0"+month:month+"";
	var date=now.getDate();
	date=date<10?"0"+date:date+"";
	var hour=now.getHours();
	hour=hour<10?"0"+hour:hour+"";
	
	var start=year+"-"+month+"-"+date;
	var end=year+"-"+month+"-"+date;
	$("#startTime").val(start);
	$("#endTime").val(end);
	
}

function initGrid(){
	var url="<%=request.getContextPath()%>/report/applyip/search.action";
	$("#ressult_div").ligerGrid({
		height:'100%',
		width:'100%',
		columns:columns,
		enabledSort:false,
		pageSize:50,
		root:"result",//数据集合
		record:"dataSize",//总数据数
		pageParmName:"pageIndex",//页索引
		pagesizeParmName:"pageLen",//页长
		usePager:true,
		dataAction:"server",
		method:"post",
		delayLoad:true,//初始化不加载
		pageSizeOptions:[20,50,100,200],
		url:url
	
	});
	var manager = $("#ressult_div").ligerGetGridManager(); 
	manager.set("height","100%");
}


function realTimesearch(){
/* 	var ipReg=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
	if($.trim($("#ips").val())!="" && !ipReg.test($("#ips").val())){
		alert("请输入正确格式的ip");
		return;
	} */
	
	var url="<%=request.getContextPath()%>/report/applyip/search.action";
	var manager = $("#ressult_div").ligerGetGridManager(); 
    manager.set("newPage",1);
    //alert($('#realTimeSearch_form').serialize());
    //manager.set("data",$('#realTimeSearch_form').serialize());
    //manager.loadServerData($('#realTimeSearch_form').serialize()); 
	manager.set("url",url+"?"+$('#realTimeSearch_form').serialize());
}

function resetSearch(){
	$("#startTime").val("");
	$("#endTime").val("");
	$("#channelCode").val("");
}

</script>
</head>
<body>

<div class="main main_max"  style="height:100%">
	<div class="form_body">
		<div class="form_body_tltle">下载ip日志视图</div>
		<form id="realTimeSearch_form">
		<table id="result_table" class="form_table">
			<tr style="height:40px; width:100%;" >
				<td width='18%' >渠道代码&nbsp;&nbsp;
					<input name="vo.et.channelCode" value="${vo.et.channelCode }"/>
				</td>
				<td width="12%" style="padding-left:3px;"></td>
				<td width="38%">抓取时间&nbsp;&nbsp;
					<input type="text"
					onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'});"
					readonly="readonly" id="startTime" name="vo.beginTime"
					/>
					&nbsp;至
					<input type="text" 
					onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'});"
					readonly="readonly" id="endTime" name="vo.endTime"
					/>
				</td>
  				<td>
				    <input type="button"  id="" value="查询" class="" onclick="realTimesearch()"/>
					<input type="button"  id="" value="重置" class="" onclick="resetSearch()"/>
				
				</td>
			</tr>
		</table>
		</form>
	</div>
	<div style="height:30px"></div>
	<div id="ressult_div" style="height:100%"><span/></div>
</div>
</body>
</html>